package com.fary.boot.context.event;

import com.fary.boot.SpringApplication;
import com.fary.context.ConfigurableApplicationContext;

@SuppressWarnings("serial")
public class ApplicationPreparedEvent extends SpringApplicationEvent {

    private final ConfigurableApplicationContext context;

    /**
     * Create a new {@link ApplicationPreparedEvent} instance.
     *
     * @param application the current application
     * @param args        the arguments the application is running with
     * @param context     the ApplicationContext about to be refreshed
     */
    public ApplicationPreparedEvent(SpringApplication application, String[] args, ConfigurableApplicationContext context) {
        super(application, args);
        this.context = context;
    }

    /**
     * Return the application context.
     *
     * @return the context
     */
    public ConfigurableApplicationContext getApplicationContext() {
        return this.context;
    }

}